﻿using System.Collections.Generic;
using Headsight.BPMN2WF.BPMN.Model;
using Rhino.Mocks;

namespace Headsight.BPMN2WF.Testing.TestObjCtors
{
    /// <summary>
    /// <see cref="BPMNArgumentFactory"/> <see cref="ITestObjCtor{T}"/>.
    /// </summary>
    public class BPMNModelFactoryBPMNArgumentCtor : ITestObjCtor<BPMNArgumentFactory>
    {
        private IList<BPMNArgument> _bpmnProcArgs;

        public BPMNArgumentFactory Create()
        {
            var result = MockRepository.GenerateStub<BPMNArgumentFactory>();

            result.Expect(x => x.CreateArguments(null, null, null)).IgnoreArguments().Return(_bpmnProcArgs);
            result.Expect(x => x.CreateArgumentsIn(null)).IgnoreArguments().Return(_bpmnProcArgs);
            result.Expect(x => x.CreateArgumentsOut(null)).IgnoreArguments().Return(_bpmnProcArgs);

            return result;
        }

        public BPMNModelFactoryBPMNArgumentCtor WithBPMNProcessArguments(IList<BPMNArgument> bpmnProcArgs)
        {
            _bpmnProcArgs = bpmnProcArgs;

            return this;
        }
    }
}